import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
const bookDetail = () => import('../components/bookDetail/bookDetail.vue')
const readBook = () => import('../components/readBook/readBook.vue')
const categoryDetail = () => import('../components/categoryDetail/categoryDetail.vue')
const bookSearch = () => import('../components/bookSearch/bookSearch.vue')
const bookSearchDetail = () => import('../components/bookSearchDetail/bookSearchDetail.vue')
Vue.use(VueRouter);
const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/category",
    name: "Category",
    component: () => import("../views/Category"),
  },
  {
    path: "/ranking",
    name: "Ranking",
    component: () => import("../views/Ranking"),
  },
  {
    path: '/bookDetail',
    name: "bookDetail",
    component: bookDetail,
    meta: {
      keepAlive: true,
    }
  },
  {
    path: '/readBook',
    name: "readBook",
    component: readBook,
    meta: {
      keepAlive: true,
    }
  },
  {
    path: '/bookSearch',
    name: "bookSearch",
    component: bookSearch,
    meta: {
      keepAlive: true,
    }
  },
  {
    path: '/bookSearchDetail',
    name: "bookSearchDetail",
    component: bookSearchDetail,
    meta: {
      keepAlive: true,
    }
  },

  {
    path: '/categoryDetail',
    name: "categoryDetail",
    component: categoryDetail,
    meta: {
      keepAlive: true,
    }
  },

];
const router = new VueRouter({
  routes,

});
export default router;
